<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>申请页面</title>
    <script src="/static/js/jquery.min.js"></script>
    <style>
        .title{
            text-align: center;
        }
    </style>
    <script>
        function showProcessImg(processInstanceId) {
            $.ajax({
                url:'/activiti/queryProHighLighted',
                type:'POST',
                data:{
                    proInsId:processInstanceId
                },
                success:function(res){
                    $("#processImg").attr('src',"data:image/png;base64,"+res);
                }
            })
        }
        function returnBack(userId){
            var form = $("<form></form>");
            form.attr("action","/activiti/queryTaskSl");
            form.attr("method","post");

            var input = $("<input type='text' name='userId'/>")
            input.attr("value",userId);
            form.append(input);

            form.appendTo("body");

            form.css("display","none");

            form.submit();

        }
    </script>
</head>
<body>
<div class="title">申请表单</div>
<a th:onclick="'javascript:returnBack(\''+${data.userId}+'\');'"><button>返回用户任务列表</button></a>
<a href="javascript:void(0);" th:onclick="'javascript:showProcessImg(\''+${task.processInstanceId}+'\')'"><button>查看流程图</button></a>
<form action="/activiti/completeTaskSl">
    <input type="hidden" id="id" name="id" th:value="${data.id}"/>
    <input type="hidden" id="userId" name="userId" th:value="${data.userId}"/>
    <input type="text" id="attr1" name="attr1"/>
    <button type="submit">提交</button>
    <button>取消</button>
</form>
<img src="" id="processImg"/>
</body>
</html>